# app/models/user.py
from sqlalchemy import Column, Integer, String
from app.database import Base

class User(Base):
    __tablename__ = "users"

    id = Column(Integer, primary_key=True, index=True)
    username = Column(String(50), unique=True, index=True)
    password = Column(String(200))
    hashed_password = Column(String)
    token_version = Column(Integer, default=0, nullable=False)  # 新增 Token 版本号 确保不能为NULL
